package com.androidme.app.examples;

import com.androidme.app.framework.base.AndroidMeActivity;
import com.androidme.app.framework.base.AndroidMeHttpTask;

public class TestBetterHttpActivity extends AndroidMeActivity {
    @Override
    protected void onPrepareData() {
        doAsync(new AndroidMeHttpTask(TestBetterHttpActivity.class.getCanonicalName(), "http://t.corp.snda.com/nst/t.php", true) {
            @Override
            protected void onHTTPException() {

            }

            @Override
            protected void onHttpResponseError(int statusCode) {

            }

            @Override
            protected void onSuccess(String s) {
            }

            @Override
            protected void onStart() {
                showProgressBar();

            }

            @Override
            protected void onStop() {
                try {
                    Thread.sleep(10000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                removeProgressBar();
            }
        });

        doAsync(new AndroidMeHttpTask(TestBetterHttpActivity.class.getCanonicalName(), "http://t.corp.snda.com/nst/t.php", true) {
            @Override
            protected void onHTTPException() {

            }

            @Override
            protected void onHttpResponseError(int statusCode) {

            }

            @Override
            protected void onSuccess(String s) {
            }

            @Override
            protected void onStart() {
                showProgressBar();

            }

            @Override
            protected void onStop() {
                try {
                    Thread.sleep(20000);
                } catch (InterruptedException e) {
                    e.printStackTrace();
                }
                removeProgressBar();
            }
        });
    }

    @Override
    protected void onRefresh() {

    }
}
